<div style="width:100%"  align="center" class="Main_Header" ><strong>QUẢN LÝ ĐƠN HÀNG</strong></div>
<div>
    <form method="post" action="">
        <table style="border-collapse: collapse;"  align="center" width="750" border="1" bordercolor="#bbbbbb" cellpadding="1" cellspacing="1" >

            <tr id="tieude">

                <td width="15%" align="center"><strong>Hóa đơn số</strong></td>
                <td width="21%" height="38" align="center"><strong>Họ tên khách nhận hàng</strong></td>
                <td width="13%" align="center"><strong>Ngày mua hàng </strong></td>
                <td width="13%" align="center"><strong>Ngày giao hàng </strong></td>
                <td width="14%" align="center"><strong>Tổng tiền (VND) </strong></td>
                <td width="9%" align="center"><strong>Trạng thái </strong></td>
                <td width="15%" align="center"><strong>Xem/Sửa hóa đơn </strong></td>
                <td width="8%" align="center"><strong>Xóa</strong></td>
            </tr>

            <?php if (count($this->listorder)){ ?>

            <?php foreach($this->listorder as $key=>$value){ ?>

                <tr>
                    <td align="center"><?=$value->oid?></td>
                    <td align="center"><?=$value->namecustomer?></td>
                    <td align="center"><?=date('d-m-Y',strtotime($value->postdate))?></td>
                    <td align="center"><?=date('d-m-Y',strtotime($value->datereceipt))?></td>
                    <td align="right"><?=number_format($value->tong,0,",",".")?></td>
                    <td align="center"><? if($value->ostatus==0) echo"Chưa xử lý"; else if($value->ostatus==1) echo"Đang xử lý"; else echo"Đã xử lý";?></td>
                    <td align="center"><a href="<?php echo PATH?>/administrator/orders/detail/<?php echo $value->oid?>">Chi tiết</a></td>
                    <td align="center"><a onClick="if(confirm('Bạn muốn xóa hóa đơn này?')) location='/mymvc/administrator/orders/delete/<?=$value->oid?>';" href="#"><? if($value->ostatus==0) echo"Xóa";?></a></td>
                </tr>

                <?php }
        }
        else {
            ?>
            <tr><td colspan="8" align="center">Không có đơn hàng nào</td></tr>


            <?php }
            ?>
            <tr>
                <td>
                    <table border="0"  align="right" cellpadding="2" cellspacing="2" ><tr>
                        <td bgcolor="#EEEEEE"  width=100px align=center style="border:#cccccc 1px solid"><b>Trang:</b></td>
                        <?
                        //echo $this->totalpage;
                        for($i=1;$i<=$this->totalpage;$i++)
                        {
                            echo '<td bgcolor="#EEEEEE" width=20px align=center style="border:#cccccc 1px solid">';
                            echo "<a href=".PATH."/administrator/orders/".$this->action."/".$i." style=".($i==$this->currenpage?'color:#FF0000;font-weight:bold':'color:#000000;font-weight:normal')."  >&nbsp;".$i."&nbsp;</a>";

                            echo '</td>';
                            if($i%15 == 0) echo "</tr>";
                        }
                        echo '</tr></table>';
                        ?>
                        </td>
                    </tr>
                    </table>
    </form>
</div>
